﻿using System;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;

namespace Trentacular.SharePoint.SmartEditorPart.Web.UI.WebParts
{
    public static class SiteMembersNamespace
    {
        public const string Value =
            "http://trentacular.com/sharepoint/sitemembers/2009/12";
    }

    /// <summary>
    /// Collection of <see cref="SiteMemberField"/> elements.
    /// </summary>
    [Serializable]
    [CollectionDataContract(Name = "Fields", Namespace = SiteMembersNamespace.Value)]
    public class SiteMemberFieldCollection : Collection<SiteMemberField> { }

    /// <summary>
    /// Represents a site user field to be displayed in the
    /// <see cref="SiteMembersWebPart" />.
    /// </summary>
    [Serializable]
    [DataContract(Name = "Field", Namespace = SiteMembersNamespace.Value)]
    public class SiteMemberField
    {
        [DataMember(Name = "DisplayName", EmitDefaultValue = false)]
        public string DisplayName { get; set; }

        [DataMember(Name = "FieldName", EmitDefaultValue = false)]
        public string FieldName { get; set; }
    }
}
